//
// CRenderTrav.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;
import org.ryzom.nel.misc.CVector;

public class CRenderTrav {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CRenderTrav(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CRenderTrav obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CRenderTrav(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CRenderTrav() {
    this(nel3dJNI.new_CRenderTrav(), true);
  }

  public void traverse(UScene.TRenderPart renderPart, boolean newRender) {
    nel3dJNI.CRenderTrav_traverse(swigCPtr, this, renderPart.swigValue(), newRender);
  }

  public void clearRenderList() {
    nel3dJNI.CRenderTrav_clearRenderList(swigCPtr, this);
  }

  public void addRenderModel(CTransform m) {
    nel3dJNI.CRenderTrav_addRenderModel(swigCPtr, this, CTransform.getCPtr(m), m);
  }

  public void reserveRenderList(long numModels) {
    nel3dJNI.CRenderTrav_reserveRenderList(swigCPtr, this, numModels);
  }

  public void removeRenderModel(CTransform m) {
    nel3dJNI.CRenderTrav_removeRenderModel(swigCPtr, this, CTransform.getCPtr(m), m);
  }

  public void clearWaterModelList() {
    nel3dJNI.CRenderTrav_clearWaterModelList(swigCPtr, this);
  }

  public void setDriver(IDriver drv) {
    nel3dJNI.CRenderTrav_setDriver(swigCPtr, this, IDriver.getCPtr(drv), drv);
  }

  public IDriver getDriver() {
    long cPtr = nel3dJNI.CRenderTrav_getDriver(swigCPtr, this);
    return (cPtr == 0) ? null : new IDriver(cPtr, false);
  }

  public IDriver getAuxDriver() {
    long cPtr = nel3dJNI.CRenderTrav_getAuxDriver(swigCPtr, this);
    return (cPtr == 0) ? null : new IDriver(cPtr, false);
  }

  public void setViewport(CViewport viewport) {
    nel3dJNI.CRenderTrav_setViewport(swigCPtr, this, CViewport.getCPtr(viewport), viewport);
  }

  public CViewport getViewport() {
    return new CViewport(nel3dJNI.CRenderTrav_getViewport(swigCPtr, this), true);
  }

  public boolean isCurrentPassOpaque() {
    return nel3dJNI.CRenderTrav_isCurrentPassOpaque(swigCPtr, this);
  }

  public void setLayersRenderingOrder(boolean directOrder) {
    nel3dJNI.CRenderTrav_setLayersRenderingOrder__SWIG_0(swigCPtr, this, directOrder);
  }

  public void setLayersRenderingOrder() {
    nel3dJNI.CRenderTrav_setLayersRenderingOrder__SWIG_1(swigCPtr, this);
  }

  public boolean getLayersRenderingOrder() {
    return nel3dJNI.CRenderTrav_getLayersRenderingOrder(swigCPtr, this);
  }

  public void setupTransparencySorting(short maxPriority, long NbDistanceEntries) {
    nel3dJNI.CRenderTrav_setupTransparencySorting__SWIG_0(swigCPtr, this, maxPriority, NbDistanceEntries);
  }

  public void setupTransparencySorting(short maxPriority) {
    nel3dJNI.CRenderTrav_setupTransparencySorting__SWIG_1(swigCPtr, this, maxPriority);
  }

  public void setupTransparencySorting() {
    nel3dJNI.CRenderTrav_setupTransparencySorting__SWIG_2(swigCPtr, this);
  }

  public void setLightingSystemEnabled(boolean value) {
    nel3dJNI.CRenderTrav_LightingSystemEnabled_set(swigCPtr, this, value);
  }

  public boolean getLightingSystemEnabled() {
    return nel3dJNI.CRenderTrav_LightingSystemEnabled_get(swigCPtr, this);
  }

  public void setAmbientGlobal(CRGBA value) {
    nel3dJNI.CRenderTrav_AmbientGlobal_set(swigCPtr, this, CRGBA.getCPtr(value), value);
  }

  public CRGBA getAmbientGlobal() {
    long cPtr = nel3dJNI.CRenderTrav_AmbientGlobal_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

  public void setSunAmbient(CRGBA value) {
    nel3dJNI.CRenderTrav_SunAmbient_set(swigCPtr, this, CRGBA.getCPtr(value), value);
  }

  public CRGBA getSunAmbient() {
    long cPtr = nel3dJNI.CRenderTrav_SunAmbient_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

  public void setSunDiffuse(CRGBA value) {
    nel3dJNI.CRenderTrav_SunDiffuse_set(swigCPtr, this, CRGBA.getCPtr(value), value);
  }

  public CRGBA getSunDiffuse() {
    long cPtr = nel3dJNI.CRenderTrav_SunDiffuse_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

  public void setSunSpecular(CRGBA value) {
    nel3dJNI.CRenderTrav_SunSpecular_set(swigCPtr, this, CRGBA.getCPtr(value), value);
  }

  public CRGBA getSunSpecular() {
    long cPtr = nel3dJNI.CRenderTrav_SunSpecular_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CRGBA(cPtr, false);
  }

  public void setSunDirection(CVector dir) {
    nel3dJNI.CRenderTrav_setSunDirection(swigCPtr, this, CVector.getCPtr(dir), dir);
  }

  public CVector getSunDirection() {
    return new CVector(nel3dJNI.CRenderTrav_getSunDirection(swigCPtr, this), true);
  }

  public void setMeshSkinManager(CVertexStreamManager msm) {
    nel3dJNI.CRenderTrav_setMeshSkinManager(swigCPtr, this, CVertexStreamManager.getCPtr(msm), msm);
  }

  public CVertexStreamManager getMeshSkinManager() {
    long cPtr = nel3dJNI.CRenderTrav_getMeshSkinManager(swigCPtr, this);
    return (cPtr == 0) ? null : new CVertexStreamManager(cPtr, false);
  }

  public CShadowMapManager getShadowMapManager() {
    return new CShadowMapManager(nel3dJNI.CRenderTrav_getShadowMapManager__SWIG_0(swigCPtr, this), false);
  }

  public void setShadowMeshSkinManager(CVertexStreamManager msm) {
    nel3dJNI.CRenderTrav_setShadowMeshSkinManager(swigCPtr, this, CVertexStreamManager.getCPtr(msm), msm);
  }

  public CVertexStreamManager getShadowMeshSkinManager() {
    long cPtr = nel3dJNI.CRenderTrav_getShadowMeshSkinManager(swigCPtr, this);
    return (cPtr == 0) ? null : new CVertexStreamManager(cPtr, false);
  }

  public void addRenderLandscape(CLandscapeModel model) {
    nel3dJNI.CRenderTrav_addRenderLandscape(swigCPtr, this, CLandscapeModel.getCPtr(model), model);
  }

  public void debugWaterModelMemory(String tag, boolean dumpList) {
    nel3dJNI.CRenderTrav_debugWaterModelMemory__SWIG_0(swigCPtr, this, tag, dumpList);
  }

  public void debugWaterModelMemory(String tag) {
    nel3dJNI.CRenderTrav_debugWaterModelMemory__SWIG_1(swigCPtr, this, tag);
  }

  public void resetLightSetup() {
    nel3dJNI.CRenderTrav_resetLightSetup(swigCPtr, this);
  }

  public void changeLightSetup(CLightContribution lightContribution, boolean useLocalAttenuation) {
    nel3dJNI.CRenderTrav_changeLightSetup(swigCPtr, this, CLightContribution.getCPtr(lightContribution), lightContribution, useLocalAttenuation);
  }

  public void beginVPLightSetup(long ctStart, boolean supportSpecular, SWIGTYPE_p_NLMISC__CMatrix invObjectWM) {
    nel3dJNI.CRenderTrav_beginVPLightSetup(swigCPtr, this, ctStart, supportSpecular, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(invObjectWM));
  }

  public void changeVPLightSetupMaterial(CMaterial mat, boolean excludeStrongest) {
    nel3dJNI.CRenderTrav_changeVPLightSetupMaterial(swigCPtr, this, CMaterial.getCPtr(mat), mat, excludeStrongest);
  }

  public static String getLightVPFragment(long numActivePointLights, long ctStart, boolean supportSpecular, boolean normalize) {
    return nel3dJNI.CRenderTrav_getLightVPFragment(numActivePointLights, ctStart, supportSpecular, normalize);
  }

  public CLight getDriverLight(int index) {
    return new CLight(nel3dJNI.CRenderTrav_getDriverLight(swigCPtr, this, index), false);
  }

  public int getStrongestLightIndex() {
    return nel3dJNI.CRenderTrav_getStrongestLightIndex(swigCPtr, this);
  }

  public void getStrongestLightColors(CRGBA diffuse, CRGBA specular) {
    nel3dJNI.CRenderTrav_getStrongestLightColors(swigCPtr, this, CRGBA.getCPtr(diffuse), diffuse, CRGBA.getCPtr(specular), specular);
  }

  public long getNumVPLights() {
    return nel3dJNI.CRenderTrav_getNumVPLights(swigCPtr, this);
  }

  public void setMeshBlockManager(CMeshBlockManager value) {
    nel3dJNI.CRenderTrav_MeshBlockManager_set(swigCPtr, this, CMeshBlockManager.getCPtr(value), value);
  }

  public CMeshBlockManager getMeshBlockManager() {
    long cPtr = nel3dJNI.CRenderTrav_MeshBlockManager_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CMeshBlockManager(cPtr, false);
  }

  public void setupDriverCamera() {
    nel3dJNI.CRenderTrav_setupDriverCamera(swigCPtr, this);
  }

  public void set_FirstWaterModel(CWaterModel value) {
    nel3dJNI.CRenderTrav__FirstWaterModel_set(swigCPtr, this, CWaterModel.getCPtr(value), value);
  }

  public CWaterModel get_FirstWaterModel() {
    long cPtr = nel3dJNI.CRenderTrav__FirstWaterModel_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CWaterModel(cPtr, false);
  }

  public final static int MaxVPLight = nel3dJNI.CRenderTrav_MaxVPLight_get();

}
